import axios from '~/axios'


//获取到角色信息
function getRole(param){
    console.log(param)
    return axios.get('/v1/role/page',{
        params: param
    })
}

//添加角色信息
function addRole(body){
    return axios.post('/v1/role/create',body)
}

//编辑角色
function updateRole(body){
    return axios.put('/v1/role/edit',body)
}

//删除角色
function deleteRole(id){
    return axios.delete(`/v1/role/del?id=${id}`)
}

//更新角色菜单表
function updateRoleMenu(body){
    return axios.put('/v1/role/updatePerm',body)
}

export default {
    getRole,
    addRole,
    updateRole,
    deleteRole,
    updateRoleMenu
}